class ApplicationController < ActionController::Base
  protect_from_forgery
  helper_method :admin?
  
  def admin?
    if session[:user_id]
      user = User.find(session[:user_id])
      user.admin
    else
	  false
   end
  end
  
  def authorize
	unless admin?
		redirect_to '/'
		false
	end
  end
 
  
  
end


